package cn.micro.eye.commons.response;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Response Meta Data Model
 *
 * @author lry
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class MetaData implements Serializable {

    private int code;
    private Object data;
    private String message;
    private String stack;
    private Timestamp time;

    public MetaData(int code, String message) {
        this(code, null, message, null, new Timestamp(System.currentTimeMillis()));
    }

    public MetaData(int code, String message, Object data) {
        this(code, data, message, null, new Timestamp(System.currentTimeMillis()));
    }

    public MetaData(int code, String message, String stack) {
        this(code, null, message, stack, new Timestamp(System.currentTimeMillis()));
    }

}
